<script type="text/html" id="taskBar">
    <button class="layui-btn layui-btn-xs layui-btn-normal" lay-event="update">更新任务</button>
    <button class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delete">删除任务</button>
</script>
{% include '页面/首页/更新任务.html' %}
{% include '页面/首页/删除任务.html' %}

<script>
    // 监听表格行工具事件
    function taskBarInit(table, form, layer, laydate, $) {
        table.on('tool(Index-ID-table-demo-page)', function (obj) {
            var data = obj.data; // 获得当前行数据
            var layEvent = obj.event; // 获得 lay-event 对应的值

            if (layEvent === 'update') {
                // 更新任务
                updateTaskFunc(data, table, form, layer, laydate, $);
            } else if (layEvent === 'delete') {
                // 删除任务
                deleteTaskFunc(data, table, layer);
            }
        });
    }

</script>